package com.smartwebx.ha.web.admin.module.screen.userConfig;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.smartwebx.ha.biz.assign.HaAreaManager;
import com.smartwebx.ha.biz.assign.HaRoleManager;
import com.smartwebx.ha.dal.assign.bean.HaArea;
import com.smartwebx.ha.dal.assign.bean.HaRole;
import com.smartwebx.ha.web.admin.common.HaUserSys;

public class Detail {
	@Autowired
	private HaRoleManager haRoleManager;
	@Autowired
	private HaAreaManager haAreaManager;
	@Autowired
	private HttpSession session;
	
	public void execute(Context context) throws Exception{
		HaUserSys userSys = (HaUserSys) session.getAttribute("haUser");
		HaRole role=haRoleManager.findOne(userSys.getRoleId());
		HaArea area=haAreaManager.findOne(userSys.getAreaId());
		context.put("role", role);
		context.put("area", area);
	}

}
